package com.gzz.controller;


import com.gzz.common.R;
import com.gzz.service.TicketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 周佳成
 * @since 2023-11-20
 */
@RestController
@RequestMapping("/api/ticket")
public class TicketController {
	@Autowired
	TicketService ticketService;


	/**
	 * find by id
	 *
	 * @param scId 景区id
	 * @author zjc
	 * @return R<String> map
	 */
	@GetMapping("/dateNum")
	public R<List<Integer>> getTicketDateNum(Long scId){
		 List<Integer> res;

		 res = ticketService.getMapForDateAndNum(scId);

		 if(res.isEmpty()){
			 return R.error("无数据");
		 }
		 return R.success(res);
	}


}

